home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / strpp212.zip / STR.HIS < prev    next >
Text File  |  1993-02-17  |  5KB  |  147 lines

  1.  
  2.                        String++ Revision History
  3.  
  4.                   Copyright (c)1993 by Carl Moreland
  5.                                 02/16/93
  6.  
  7. -----------------------------------------------------------------------
  8.  
  9. Version 2.12
  10.  
  11. - Fixed bug in the Copy() function. Copy() will allocate memory for the
  12.   char* and therefore should be passed an uninitialized pointer:
  13.  
  14.   char *p;
  15.   s1.Copy(p);    // allocates memory for p & copies s1 to it
  16.  
  17. - split() is now called with just the array name instead of an address
  18.   to the array:
  19.  
  20.   string *array;
  21.   n = split(str1, &array, " ");        // Old way
  22.   n = split(str1, array, " ");        // New way
  23.  
  24.   Memory for array is still allocated within the split function.
  25.  
  26. - A cast operator has been added. This allows a string instance to be
  27.   passed where a char* is expected. Previously, you had to use the ()
  28.   operator or the ptr() function to return the char* contents of a
  29.   string:
  30.  
  31.   string s = "Hello";
  32.   char p[6];
  33.  
  34.   strcpy(p,s());    // old way
  35.   strcpy(p, s);        // new way
  36.  
  37.   The cast operator returns a const char* just like the () operator.
  38.  
  39. - Added Zortech C++ support (Stephen Kawamoto)
  40.  
  41. -----------------------------------------------------------------------
  42.  
  43. Version 2.11
  44.  
  45. - Fixed bug in int constructor.
  46.  
  47. -----------------------------------------------------------------------
  48.  
  49. Version 2.10
  50.  
  51. - Derived class String from class string for those who prefer the capi-
  52.   talized spelling.
  53.  
  54. - Minor documentation changes
  55.  
  56. -----------------------------------------------------------------------
  57.  
  58. Version 2.01
  59.  
  60. - Minor bug fixes
  61.  
  62. -----------------------------------------------------------------------
  63.  
  64. Version 2.0
  65.  
  66. - Added iostream support.
  67.  
  68. - Enhanced [] operator can now assign individual characters.
  69.  
  70. - Comparison functions are now implemented as inline.
  71.  
  72. - New general functions:
  73.  
  74.   Insert()    inserts text in str
  75.   Delete()      deletes a substring of str
  76.   Copy()        copies str to a non-const char*
  77.   Trim()    trims leading or trailing multiple chars from str.
  78.   Value()       returns the numeric value (int or long) of str.
  79.  
  80. - Existing methods have been renamed to begin with an uppercase letter,
  81.   such as string::justify() -> string::Justify(). The older naming con-
  82.   ventions are still supported for backwards compatibility. Most member
  83.   methods now operate directly on the string itself instead of returning
  84.   a new string. For example, str1.Justify() will modify str1 instead of
  85.   creating a new string. C-style function names remain all lower-case
  86.   and return newly created strings, so str2 = justify(str1, LEFT, 80)
  87.   will not modify str1.
  88.  
  89. - AWK functions are also implemented as member methods that directly
  90.   modify the string object. These versions begin with an uppercase.
  91.  
  92. - Constructors and = operators added for int & long data types. New
  93.   function Value() returns the numeric value of a string.
  94.  
  95. - The () operator continues to return a const char* to the string
  96.   object's data, but the ptr() method now returns a non-const char*.
  97.   Therefore, if you need to pass a string's contents to a C-style func-
  98.   tion that wants a non-const char*, use ptr():
  99.  
  100.   Old way:
  101.  
  102.         strupr((char *)s1());    // strupr() wants to modify s1 directly
  103.                                 //   so s1 must be cast as non-const
  104.   New way:
  105.  
  106.       strupr(s1.ptr());       // s1.ptr() is now non-const
  107.  
  108.   Returning a non-const char* completely strips the inherent protection
  109.   that the string class offers and can be very dangerous. Use this with
  110.   caution.
  111.  
  112. -----------------------------------------------------------------------
  113.  
  114. Version 1.1
  115.  
  116. - Bug fixes, mostly memory leaks.
  117.  
  118. - Rewrote several functions for improved efficiency.
  119.  
  120. - Improved demo program.
  121.  
  122. - gsub() is generalized with the inclusion of a num parameter.
  123.  
  124. - New justify() function.
  125.  
  126. - New operators * and *=.
  127.  
  128. -----------------------------------------------------------------------
  129.  
  130. Version 1.0
  131.  
  132. - Initial release.
  133.  
  134. -----------------------------------------------------------------------
  135.  
  136. Comments, suggestions, and bug reports are welcomed. Send them to me
  137. via Internet (carl.moreland@analog.com), CompuServe (72137,2657), or
  138. mail them to:
  139.  
  140.         Carl Moreland
  141.         4314 Filmore Rd
  142.         Greensboro, NC 27409
  143.  
  144. The latest version of this software can be found on CompuServe in the
  145. Borland C++ forum (GO BCPPDOS, Lib 6) or on Internet in the Simtel20
  146. archives (oak.oakland.edu or ftp.uu.net).
  147.